#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int score;
	int max = 0;
	int min = 100;
	int i = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%d", &score);
		if (score > max)
			max = score;
		if (score < min)
			min = score;
	}
	printf("%d\n", max - min);
	return 0;
}